<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>doublebind</title>
</head>
<body>
    <div id="app">
        <!--给div声明一个class属性然后，从数据模型中取值-->
        <!--y也可以通过这种动态取值运算后赋值-->
        <div :class="{ active: isActive, 'text-danger': hasError }">
            abc
        </div>
    </div>
<script src="./node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            isActive: true,
            hasError: true
        }
    })
</script>
</body>
</html>